//
//  PassWordViewController.m
//  01-UIViewHomeWork
//
//  Created by dllo on 16/7/15.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "PassWordViewController.h"
#define WIDTH self.view.frame.size.width
#define HEIGHT self.view.frame.size.height
@interface PassWordViewController ()<UITextFieldDelegate>

@end

@implementation PassWordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tabBarController.tabBar.hidden=YES;
    self.view.backgroundColor = [UIColor whiteColor];
    [self creatPassWordVC];

}
- (void)creatPassWordVC {
    // 背景
    UIImageView *imageBackGround = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, WIDTH, HEIGHT)];
    [imageBackGround setImage:[UIImage imageNamed:@"welcome_2"]];
    [self.view addSubview:imageBackGround];
    // logo
    UIImageView *imageLogo = [[UIImageView alloc] initWithFrame:CGRectMake(WIDTH / 3, HEIGHT / 9, WIDTH / 3, 200)];
    [imageLogo setImage:[UIImage imageNamed:@"logo_lagou"]];
    [imageBackGround addSubview:imageLogo];
    // 手机号
    UITextField *textIphone = [[UITextField alloc] initWithFrame:CGRectMake(90, 300, WIDTH - 110, 50)];
    textIphone.delegate = self;
    textIphone.backgroundColor = [UIColor blackColor];
    textIphone.alpha = 0.2;
    [textIphone.layer setCornerRadius:10.0];
    textIphone.textColor = [UIColor lightGrayColor];
    textIphone.placeholder = @"手机号";
    textIphone.textAlignment = 1;
    textIphone.keyboardType = UIKeyboardTypeNumberPad;
    textIphone.returnKeyType = UIReturnKeyDone;
    textIphone.clearsOnBeginEditing = YES;
    textIphone.borderStyle = UITextBorderStyleBezel;
    [textIphone setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
    textIphone.clearsOnBeginEditing = YES;
    textIphone.textColor = [UIColor whiteColor];
    [self.view addSubview:textIphone];
    // Email
    UITextField *textEmail = [[UITextField alloc] initWithFrame:CGRectMake(90, 360, WIDTH - 110, 50)];
    textEmail.backgroundColor = [UIColor blackColor];
    textEmail.alpha = 0.2;
    [textEmail.layer setCornerRadius:10.0];
    textEmail.textColor = [UIColor lightGrayColor];
    textEmail.placeholder = @"邮箱";
    textEmail.textAlignment = 1;
    textEmail.clearsOnBeginEditing = YES;
    textEmail.keyboardType = UIKeyboardTypeNumberPad;
    textEmail.returnKeyType = UIReturnKeyDone;
    textEmail.borderStyle = UITextBorderStyleBezel;
    [textEmail setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
    textEmail.clearsOnBeginEditing = YES;
    textEmail.textColor = [UIColor whiteColor];
    [self.view addSubview:textEmail];
    // 新密码
    UITextField *newTextPassWord = [[UITextField alloc] initWithFrame:CGRectMake(90, 420, WIDTH - 110, 50)];
    newTextPassWord.backgroundColor = [UIColor blackColor];
    newTextPassWord.alpha = 0.2;
    [newTextPassWord.layer setCornerRadius:10.0];
    newTextPassWord.textColor = [UIColor lightGrayColor];
    newTextPassWord.clearsOnBeginEditing = YES;
    newTextPassWord.borderStyle = UITextBorderStyleBezel;
    newTextPassWord.keyboardType = UIKeyboardTypeNumberPad;
    newTextPassWord.returnKeyType = UIReturnKeyDone;
    newTextPassWord.placeholder = @"请输入新密码";
    newTextPassWord.textAlignment = 1;
    [newTextPassWord setValue:[UIColor lightGrayColor] forKeyPath:@"_placeholderLabel.textColor"];
    newTextPassWord.clearsOnBeginEditing = YES;
    newTextPassWord.textColor = [UIColor blackColor];
    [self.view addSubview:newTextPassWord];
    
    UILabel *labelIphone = [[UILabel alloc] initWithFrame:CGRectMake(10, 300, 60, 50)];
    labelIphone.text = @"手机:";
    labelIphone.textColor = [UIColor colorWithRed:0.01 green:0.79 blue:0.53 alpha:1.00];
    [self.view addSubview:labelIphone];
    
    UILabel *labelEmail = [[UILabel alloc] initWithFrame:CGRectMake(10, 360, 60, 50)];
    labelEmail.text = @"邮箱:";
    labelEmail.textColor = [UIColor colorWithRed:0.01 green:0.79 blue:0.53 alpha:1.00];
    [self.view addSubview:labelEmail];
    
    UILabel *labelNewPassword = [[UILabel alloc] initWithFrame:CGRectMake(10, 420, 60, 50)];
    labelNewPassword.text = @"新密码:";
    labelNewPassword.textColor = [UIColor colorWithRed:0.01 green:0.79 blue:0.53 alpha:1.00];
    [self.view addSubview:labelNewPassword];
    UIButton *btnOK = [UIButton buttonWithType:UIButtonTypeCustom];
    btnOK.frame = CGRectMake(WIDTH / 2, 520, WIDTH / 3 , 55);
    btnOK.backgroundColor = [UIColor blackColor];
    btnOK.alpha = 0.3;
    [btnOK setTitle:@"确定找回" forState:UIControlStateNormal];
    [btnOK setTitleColor:[UIColor colorWithRed:0.01 green:0.79 blue:0.53 alpha:1.00] forState:UIControlStateNormal];
    [self.view addSubview:btnOK];
    UIButton *btnBack = [UIButton buttonWithType:UIButtonTypeCustom];
    btnBack.frame = CGRectMake(10, 15, 50, 20);
    [btnBack setTitle:@"返回" forState:UIControlStateNormal];
    [btnBack setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.view addSubview:btnBack];
    [btnBack addTarget:self action:@selector(backBtn:) forControlEvents:UIControlEventTouchUpInside];
}
// 处理点击return, 需要进行的操作 回收键盘
- (BOOL)textFieldShouldReturn:(UITextField *)textField {
    // 回收键盘
    [textField endEditing:YES];
    return YES;
}
- (void)backBtn:(UIButton *)sender {
    //[self dismissViewControllerAnimated:YES completion:nil];
    [self.navigationController popViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
